import R from "@common/type/response";
import { NextApiResponse } from "next";
import * as userService from '@/common/service/sys_user';
import { AuthenticatedRequest, withAuth } from '@common/middleware/auth';

export async function handler(req: AuthenticatedRequest, res: NextApiResponse) {
    const query = req.query;
    var start = query._start || 0;
    var end = query._end || 10;
    const data = await userService.getUserList(query, start as number, end as number);
    R.success(res, data);
}

export default withAuth(handler); 